class Book:
    """
    书的实体类
    """

    def __init__(self, book_id, book_name):
        """
        书的构造函数
        :param book_id:书的编号
        :param book_name: 书名
        """
        self.book_id = book_id
        self.book_name = book_name

    def to_dict(self):
        return {self.book_id: self.book_name}


class User:
    """
    读者的实体类
    """

    def __init__(self, user_id, user_name):
        """
        读者构造函数
        :param user_id: 用户id
        :param user_name: 用户名
        """
        self.user_id = user_id
        self.user_name = user_name

    def to_dict(self):
        return {self.user_id: self.user_name}


class Record:
    """
    图书借阅记录
    """

    def __init__(self, user_id, book_id):
        """
        图书借阅记录构造函数
        :param user_id: 用户id
        :param book_id: 用户名
        """
        self.user_id = user_id
        self.book_id = book_id

    def to_tuple(self):
        return self.user_id, self.book_id
